﻿using System.Collections.Generic;
using IdentityServer4.Models;

namespace Sayook.Framework.Template.IdentityServer
{
    public static class Config
    {
        public static IEnumerable<ApiResource> Apis => new List<ApiResource>
        {
            new ApiResource("TemplateApi", "Sayook Framework Template API")
        };

        public static IEnumerable<Client> Clients => new List<Client>
        {
            new Client
            {
                ClientId = "client",

                // no interactive user, use the clientid/secret for authentication
                AllowedGrantTypes =GrantTypes.ClientCredentials,

                // secret for authentication
                ClientSecrets =
                {
                   new Secret("123456".Sha256())
                },

                // scopes that client has access to
                AllowedScopes = { "TemplateApi" },

                AccessTokenLifetime = 1 * 60
            }
        };
    }
}